Skip to content

Conversation

@romainneutron
Copy link
Contributor

No description provided.

@pjcdawkins pjcdawkins requested a review from Copilot October 31, 2025 17:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the activity result display logic to show activities as "failing" when any command within the activity has a non-zero exit code, regardless of the overall activity result status.

  • Changed formatResult method signature to accept an Activity object instead of just the result string
  • Added logic to check command exit codes and override the result display to show failure when any command fails
  • Updated all callers to pass the full Activity object to the modified method

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Service/ActivityMonitor.php Modified formatResult method to check command exit codes and override result display
src/Command/Integration/Activity/IntegrationActivityListCommand.php Updated to pass Activity object to formatResult method
src/Command/Activity/ActivityListCommand.php Updated to pass Activity object to formatResult method
src/Command/Activity/ActivityGetCommand.php Added conditional logic to use formatResult for result property

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


foreach ($activity->commands ?? [] as $command) {
if ($command['exit_code'] > 0) {
$name = Activity::RESULT_FAILURE;
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic overrides $name but still uses the original $result variable in the decoration check on line 601. This means activities with failed commands will show the failure text but won't get the error styling if the original result wasn't a failure. Consider also setting $result = Activity::RESULT_FAILURE; when a command fails.

Suggested change
$name = Activity::RESULT_FAILURE;
$name = Activity::RESULT_FAILURE;
$result = Activity::RESULT_FAILURE;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant